package main

import (
	"encoding/json"
	"executeserver/src/model"
	"fmt"
)

type User struct {
	Name    string
	Age     string
	Address *string
}

var rows = map[int]map[string]string{
	1: {
		"name": "zs",
		"age":  "20",
	},
}

func main() {
	fmt.Println(rows)
	// var str = `{"host":"127.0.0.1","port":6379,"password":"aa778899"}`
	client := model.GetLocalRedis()

	fmt.Println(client)
	v, _ := json.Marshal(rows[1])
	fmt.Println(string(v))
	// str = string(v)
	var u User
	err := json.Unmarshal(v, &u)
	fmt.Println(u, err)
	u1 := u
	u1.Age = "40"
	fmt.Println(u1)
	fmt.Println(u)
	// val, err := client.Set("test", v, 0).Result()
	// if err != nil {
	// 	log.Println(err)
	// 	return
	// }
	// log.Println("set key", val, err)
	// val1, _ := client.Get("test").Result()
	// fmt.Printf("%T", val1)

	fmt.Println("=========")
	var s = map[string]string{
		"key": "value",
	}
	s1 := s
	setItem(s1)
	fmt.Println("s1", s1)
	fmt.Println("s", s)
}
func setItem(s1 map[string]string) {
	s1["key"] = "value2"
}
